import { Post } from './api.js';
//var api = require("./api.js").default;

const XSURL = '/xs';
const url = {
    indexxsgz: XSURL + "/api/index",
    updatexsgz: XSURL + "/api/update",
    savexsgz: XSURL + "/api/save",
    deletexsgz: XSURL + "/api/delete",

    indexkhgz: XSURL + "/api/indexkhgz",
    updatekhgz: XSURL + "/api/updatekhgz",
    savekhgz: XSURL + "/api/savekhgz",
    deletekhgz: XSURL + "/api/deletekhgz",

    indexqtgz: XSURL + "/api/indexqtgz",
    updateqtgz: XSURL + "/api/updateqtgz",
    saveqtgz: XSURL + "/api/saveqtgz",
    deleteqtgz: XSURL + "/api/deleteqtgz",

    indexgzwt: XSURL + "/api/indexgzwt",
    updategzwt: XSURL + "/api/updategzwt",
    savegzwt: XSURL + "/api/savegzwt",
    deletegzwt: XSURL + "/api/deletegzwt",
}

export const indexxsgz = (params = {}) => {
    return new Promise((resolve, reject) => {
        Post(url.indexxsgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const updatexsgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.updatexsgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const savexsgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.savexsgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const deletexsgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.deletexsgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const indexkhgz = (params = {}) => {
    return new Promise((resolve, reject) => {
        Post(url.indexkhgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const updatekhgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.updatekhgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const savekhgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.savekhgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const deletekhgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.deletekhgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const indexqtgz = (params = {}) => {
    return new Promise((resolve, reject) => {
        Post(url.indexqtgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const updateqtgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.updateqtgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const saveqtgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.saveqtgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const deleteqtgz = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.deleteqtgz, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const indexgzwt = (params = {}) => {
    return new Promise((resolve, reject) => {
        Post(url.indexgzwt, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const updategzwt = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.updategzwt, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const savegzwt = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.savegzwt, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const deletegzwt = (params = { data }) => {
    return new Promise((resolve, reject) => {
        Post(url.deletegzwt, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export default {
    indexxsgz, updatexsgz, savexsgz, deletexsgz,
    indexkhgz, updatekhgz, savekhgz, deletekhgz,
    indexqtgz, updateqtgz, saveqtgz, deleteqtgz,
    indexgzwt, updategzwt, savegzwt, deletegzwt
}